package net.homelinux.chaoswg.io.renga.core.gui.operations.reader;

import net.homelinux.chaoswg.io.higherorderfunctions.AbstractUnaryFunction;
import net.homelinux.chaoswg.io.higherorderfunctions.UnaryFunction;
import net.homelinux.chaoswg.io.renga.core.gui.operations.Operation;
import net.homelinux.chaoswg.io.renga.core.gui.operations.VariablePutOperation;

import org.jdom.Element;

public class VariablePutOperationReader extends AbstractUnaryFunction<Operation, Element> implements UnaryFunction<Operation, Element>, OperationReader {

    public Operation apply(final Element arg0) throws IllegalArgumentException {
        final VariablePutOperation vpo = new VariablePutOperation();
        
        vpo.setName(arg0.getChildText("name"));
        
        final CommonOperationReader cor = new CommonOperationReader ();
        cor.apply(vpo, arg0);
        
        return vpo;
    }
}

